﻿/**********************************************************************
* @file   FITKAcousticsLoadCaseMgrAdaptor.h
* @brief  求解的载荷工况读写适配器
* @author yangjing (1195810980@qq.com)
* @date   2025-02-25
*********************************************************************/
#ifndef _FITFK_ACOUSTICS_LOAD_CASE_ADAPTOR_H___
#define _FITFK_ACOUSTICS_LOAD_CASE_ADAPTOR_H___

#include "FITKAcousticsAbstractAdaptor.h"
#include "FITK_Kernel/FITKCore/FITKCoreMacros.h"
#include "FITK_Kernel/FITKAdaptor/FITKIOAdaptorFactory.h"
#include "FITK_Component/FITKAcousticsPhysics/FITKAcousticsAbstractLoad.h"
#include <H5Cpp.h>
namespace IO {
    class FITKHDF5FileTool;
}

namespace Acoustics {
    class FITKSolverLoadCaseManager;
}

namespace IO
{
    class FITKAcousticsHDF5IOAPI FITKAcousticsLoadCaseMgrAdaptor : public FITKAcousticsAbsAdaptor
    {
    public:
        explicit FITKAcousticsLoadCaseMgrAdaptor() = default;
        virtual ~FITKAcousticsLoadCaseMgrAdaptor() = default;

        virtual bool adaptR() override;

        virtual bool adaptW() override;

    private:
        /**
       * @brief 写求解的载荷工况数据
       * @param @param[i]  gp      hdf5组别
       * @param @param[i]  LoadCase    需要被写入的管理器
       * @author yangjing (1195810980@qq.com)
       * @date 2024-2-25
       */
        bool writeData(H5::Group&gp, Acoustics::FITKSolverLoadCaseManager* LoadCase);

        /**
       * @brief 读求解的载荷工况数据
       * @param @param[i]  gp      hdf5组别
       * @param @param[i]  LoadCase    需要被写入的管理器
       * @author yangjing (1195810980@qq.com)
       * @date 2024-2-25
       */
        bool readData(H5::Group&gp, Acoustics::FITKSolverLoadCaseManager* LoadCase);

    private:
        IO::FITKHDF5FileTool*m_toolp{ nullptr };
    };
    Register2FITKIOAdaptorFactory(FITKAcousticsHDF5, Acoustics::FITKSolverLoadCaseManager, FITKAcousticsLoadCaseMgrAdaptor);
}
#endif
